package com.gnerv.battle.boot.module.base.model.bo;

import com.gnerv.battle.boot.module.base.model.entity.Dict;
import com.gnerv.battle.boot.common.tools.DateTimeTools;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author Gnerv LiGen
 */
@Data
public class DictBO {

    private String ukId;
    private String code;
    private String name;
    private String status;
    private Integer sort;

    public Dict toCreateDict() {
        Dict dict = new Dict();
        BeanUtils.copyProperties(this, dict);
        dict.setGmtCreate(DateTimeTools.currentTimeMillis());
        dict.setGmtModified(DateTimeTools.currentTimeMillis());
        return dict;
    }

    public Dict toUpdateDict() {
        Dict dict = new Dict();
        BeanUtils.copyProperties(this, dict);
        dict.setGmtModified(DateTimeTools.currentTimeMillis());
        return dict;
    }

}